<!DOCTYPE html>
<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8" %>
<%@ include file="../core/core.jsp" %>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <title>首页配置</title>
    <meta name="keywords" content="叮当猫">
    <meta name="description" content="叮当猫">
    <link href="../static/css/summernote.css" rel="stylesheet">
    <link href="../static/css/summernote-bs3.css" rel="stylesheet">
    <link href="../static/css/cropper.min.css" rel="stylesheet">
    <link href="../static/css/sitelogo.css" rel="stylesheet">
    <link rel="stylesheet" href="../static/css/artEditor.css">
    <link rel="stylesheet" href="../static/zyupload/skins/zyupload-1.0.0.min.css " type="text/css">
<%-- <script type="text/javascript" src="../static/zyupload/jquery-1.7.2.js"></script>--%>
    <script type="text/javascript" src="../static/zyupload/zyupload.drag-1.0.0.min.js"></script>
    <script src="../static/js/photoClip/cropper.js"></script>
    <script src="../static/js/photoClip/sitelogo.js"></script>
    <style>
        #clipArea {
            margin: 20px;
            height: 300px;
        }

        #file,
        #clipBtn {
            margin: 20px;
        }

        #view {
            margin: 0 auto;
            width: 200px;
            height: 200px;
        }

        table.dataTable thead .sorting:after {
            content: '';
        }

        .editDetail, #editState, #keepState, #editInventory, #saveInventory, .editAll {
            background-color: #49c9bb;
            color: #FFFFFF;
            display: inline-block;
            padding: 6px 12px;
            font-size: 14px;
            font-weight: 400;
            line-height: 1.42857143;
            text-align: center;
            vertical-align: middle;
            cursor: pointer;
            border-radius: 4px;
            margin-top: 10px;
            white-space: nowrap;
        }

        #editState, #keepState, #editInventory, #saveInventory {
            margin-top: 0;
        }

        .spe_title input, .spe_detail input {
            margin-right: 27px;
            margin-bottom: 10px;
        }

        .spe_title img {
            position: absolute;
            top: -10px;
            right: -11px;
            width: 24px;
            height: 24px;
        }

        .spe_detail img {
            position: absolute;
            top: -10px;
            right: 12px;
            width: 24px;
            height: 24px;
        }

        input[type=checkbox] {
            width: 18px;
            height: 18px;
            margin: 0 20px 0 4px;
            vertical-align: middle;
        }
        .delItem{
            cursor: pointer;
            text-decoration: underline;
        }
        .oneImgBox,.oneImgBox2{
            position: relative;
            width: 80px;
            height: 66px;
            margin-right: 10px;
            float: left;
        }
        .oneImgBox img,.oneImgBox2 img{
            width: 66px;
            height: 66px;
            display: block;
        }
        .oneImgBox span,.oneImgBox2 span{
            width: 18px;
            height: 18px;
            font-size: 18px;
            line-height: 18px;
            position: absolute;
            top:0;
            right: 0;
            cursor: pointer;
        }
        .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus{
              background-color: #dddddd;
          }

    </style>
</head>

<body>

<div>
    <ul class="nav nav-tabs">
        <li class="liList active" id="indexlabeltitle"><a>①首页标签</a></li>
        <li class="liList" id="slideshowtitle"><a>②首页轮播图</a></li>
        <li class="liList" id="functiontitle"><a>③功能菜单</a></li>
        <li class="liList" id="activitiesSectiontitle" ><a>④活动版块1</a></li>
        <li class="liList" id="activitiesSectiontitle2" ><a>④活动版块2</a></li>
    </ul>
</div>

<div class="bigBox">
    <div class="panel panel-default" id="banmian" style="display: none;">
        <div class="panel-body">
            <table class="table table-hover">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>配置类型</th>
                    <th>状态</th>
                    <th>名称</th>
                    <th>图片路径</th>
                    <th>跳转路径</th>
                    <th>序号</th>
                    <th>备注</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody id="datetable">
                </tbody>
            </table>
        </div>
    </div>
    <div class="bigBox">
        <div class="panel panel-default" id="banmian2" style="display: none;">
            <div class="panel-body">
                <table class="table table-hover">
                    <thead>
                    <tr>
                        <th>ID</th>
                        <th>类型</th>
                        <th>标题名称</th>
                        <th>说明</th>
                        <th>状态</th>
                        <th>图片路径</th>
                        <th>跳转路径</th>
                        <th>APP路径</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody id="datetable2">
                    </tbody>
                </table>
            </div>
        </div>


        <div class="modal inmodal fade" id="myModal5" tabindex="-1" role="dialog"  aria-hidden="true">
            <div class="modal-dialog modal-lg">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                        <h4 class="modal-title" id="mdtitle1" style="display: none">修改首页标签</h4>
                        <h4 class="modal-title" id="mdtitle2" style="display: none">修改首页轮播图</h4>
                        <h4 class="modal-title" id="mdtitle3" style="display: none">修改功能菜单</h4>
                    </div>
                    <div class="modal-body">

                        <div class="form-group"><label>配置类型</label> <input type="text" id="type"  class="form-control"   disabled> </div>
                        <div class="form-group"><label>名称</label> <input type="text" id="name" placeholder="请输入名称" class="form-control" ></div>
                        <div class="form-group"><label>跳转路径</label> <input type="text" id="url" placeholder="请输入跳转路径" class="form-control" ></div>
                        <div class="form-group"><label>序号</label> <input type="text" id="number" placeholder="请输入序号" class="form-control"></div>
                        <div class="form-group"><label>备注</label> <input type="text" id="memo"  class="form-control" ></div>
                        <div class="form-group"><label>状态</label>
                            <select name="level" id="state" style="height: 34px;">
                                <option value="1">有效</option>
                                <option value="0">无效</option>
                            </select>
                        </div>
                        <div class="form-group"><label>图片路径</label> <input type="text" id="img" placeholder="请输入图片路径" class="form-control" ></div>


                    </div>

                    <div class="modal-footer">
                        <button type="button" class="btn btn-white" data-dismiss="modal" id="close">关闭</button>
                        <button type="button" class="btn btn-primary" id="save" >保存</button>

                    </div>
                </div>
            </div>
        </div>

        <div class="modal inmodal fade" id="myModal" tabindex="-1" role="dialog"  aria-hidden="true">
            <div class="modal-dialog modal-lg">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                        <h4 class="modal-title" id="mdtitle4" style="display: none">修改活动版块</h4>

                    </div>
                    <div class="modal-body">
                        <div class="form-group"><label>类型</label> <input type="text" id="type2"  class="form-control" > </div>
                        <div class="form-group"><label>标题名称</label> <input type="text" id="name2"  class="form-control" > </div>
                        <div class="form-group"><label>说明</label> <input type="text" id="shortName"  class="form-control"> </div>

                        <div class="form-group"><label>状态</label>
                            <select name="level" id="state2" style="height: 34px;">
                                <option value="1">有效</option>
                                <option value="0">无效</option>

                            </select>
                        </div>
                        <div class="form-group"><label>图片路径</label> <input type="text" id="img2" placeholder="请输入图片路径" class="form-control" ></div>
                        <div class="form-group"><label>跳转路径</label> <input type="text" id="url2" placeholder="请输入跳转路径" class="form-control" ></div>
                        <div class="form-group"><label>APP路径</label> <input type="text" id="appUrl" placeholder="请输入跳转路径" class="form-control" ></div>

                    </div>

                    <div class="modal-footer">
                        <button type="button" class="btn btn-white" data-dismiss="modal" id="close2">关闭</button>
                        <button type="button" class="btn btn-primary" id="save2" >保存</button>

                    </div>
                </div>
            </div>
        </div>

      <script type="text/javascript">;
      var mainImageUrlAll ='';
      $(function(){
              // 初始化插件
              $("#zyupload").zyUpload({
                  width            :   "650px",                 // 宽度
                  height           :   "400px",                 // 宽度
                  itemWidth        :   "140px",                 // 文件项的宽度
                  itemHeight       :   "115px",                 // 文件项的高度
                  url              :   "/crm/uploadImage.do",  // 上传文件的路径
                  fileType         :   ["jpg","png","js","exe"],// 上传文件的类型
                  fileSize         :   51200000,                // 上传文件的大小
                  multiple         :   true,                    // 是否可以多个文件上传
                  dragDrop         :   true,                    // 是否可以拖动上传文件
                  tailor           :   false,                    // 是否可以裁剪图片
                  del              :   true,                    // 是否可以删除文件
                  finishDel        :   false,  				  // 是否在上传文件完成后删除预览
                  /* 外部获得的回调接口 */
                  onSelect: function(selectFiles, allFiles){    // 选择文件的回调方法  selectFile:当前选中的文件  allFiles:还没上传的全部文件
                      console.info("当前选择了以下文件：");
                      console.info(selectFiles);
                  },
                  onDelete: function(file, files){              // 删除一个文件的回调方法 file:当前删除的文件  files:删除之后的文件
                      console.info("当前删除了此文件：");
                      console.info(file.name);
                  },
                  onSuccess: function(file, response){// 文件上传成功的回调方法
                      console.info("此文件上传成功：");
                      console.info(file.name);
                      console.info("此文件上传到服务器地址：");
                      console.info(response);
                      var args = response.split("|");
                      mainImageUrlAll+=args[1]+",";
                      //铺出来上传成功后的图片
                      if(ifSpeImg=='false'){
                          $('#imgBox').append(
                              '<div class="oneImgBox"><img  src="'+args[1]+'" alt="img" ifShow="true" style="width: 66px;height: 66px;"><span>×</span></div>'
                          );
                      }else{
                          $('#imgBox2').empty();
                          $('#imgBox2').append('<div class="oneImgBox2"><img id="mainImg2" src="'+args[1]+'" alt="img" style="width: 66px;height: 66px;"><span class="del">×</span></div>')
                      }
                      $("#uploadInf").append("<p>上传成功，文件地址是：" + response + "</p>");
                  },
                  onFailure: function(file, response){          // 文件上传失败的回调方法
                      console.info("此文件上传失败：");
                      console.info(file.name);
                  },
                  onComplete: function(response){           	  // 上传完成的回调方法
                      console.info("文件上传完成");
                      console.info(response);
                  }
              });

          });

      </script>



    </div>
        </div>
</div>
<div class="loading" aria-label="Loading" role="img" tabindex="-1"></div>

<script src="../static/js/ajaxfileupload_v1.js"></script>
<script src="../static/js/photoClip/html2canvas.min.js" type="text/javascript" charset="utf-8"></script>
<!-- SUMMERNOTE -->
<script src="../static/js/plugins/summernote.min.js"></script>
<script src="../static/js/plugins/summernote-zh-CN.js"></script>
<script>
    $(document).ready(function () {

        $('.summernote').summernote({
            lang: 'zh-CN'
        });

    });
    var edit = function () {
        $("#eg").addClass("no-padding");
        $('.click2edit').summernote({
            lang: 'zh-CN',
            focus: true
        });
    };
    var save = function () {
        $("#eg").removeClass("no-padding");
        var aHTML = $('.click2edit').code(); //save HTML If you need(aHTML: array).
        $('.click2edit').destroy();
    };
</script>
<!-- 配置文件 -->
<script type="text/javascript" src="../static/js/ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="../static/js/ueditor/ueditor.all.min.js"></script>
<script src="../static/js/indexConfig/details.js" charset="utf-8"></script>
<script>

</script>
</body>

</html>
